<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<script type="text/javascript" src="__PUBLIC__/Home/js/jquery-1.11.1.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Home/layer_m/layer.js"></script>
	<form action="" method="post">
		
		<P>用户名<input type="text" name="username" class="una"></P>
		<P>密码<input type="text" name="password" class="upa"></P>
		<button type="button" class="submit">登陆</button>
	</form>
	<script type="text/javascript">
		$(".submit").click(function(){
			var username=$(".una").val();
			var password=$(".upa").val();
			$.ajax({
				method:'post',
				url:"{:U('User/login')}",
				dataType:'json',
				data:{
					username:username,
					password:password
				},
				success:function(data){
					console.log(data.status)
					layer.open({
						content:data.msg
						  ,btn: '我知道了'
						  });
					if(data.status==2000){
						window.location.href="{:U('User/Index')}"
					}
				}
			})
		})
		

	</script>
</body>
</html>